package chapter8;

import java.util.ArrayList;
import java.util.Random;

/**
 * @Author juzipi
 * @Date 2021/5/20 11:26
 * @Info
 */
public class OOMTest {

    public static void main(String[] args) {

        ArrayList<Object> objects = new ArrayList<>();
        while (true){
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            objects.add(new Picture(new Random().nextInt(1024 * 1024)));
        }

    }
}
class Picture{
    private byte[] pixels;

    public Picture(int length){
        this.pixels = new byte[length];
    }


}